package com.freedom.admin.infrastructure.persistence.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.freedom.admin.infrastructure.persistence.pojo.po.SysRolePermissionPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysRolePermissionMapper extends BaseMapper<SysRolePermissionPO> {


    /**
     * 获取角色拥有的权限ID集合
     *
     * @param roleId
     * @return
     */
    List<Integer> selectPermissionIdsByRoleId(Integer roleId);

    void insertRolePermission(@Param("roleId") Integer roleId, @Param("permIds") List<Integer> permIds);

    void deleteRolePermission(@Param("roleId") Integer roleId, @Param("permIds") List<Integer> permIds);
}
